DP G bad
DP_G bad
PyPy 15TLE
code:python
def solve(N, M, edges):
path = edges.copy()
exists = 1
for i in range(2, M + 1):
next_path = defaultdict(set)
for v1 in path:
next_pathv1.update(edgesv2) exists = i
if exists != i:
# no more pathes
break
path = next_path
return exists
---
This page is auto-translated from /nishio/DP G bad. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.